<?php

/**
* @author trungdt
* @since Feb 2011
* 
*/
/**
* Change logs
* Feb 11, 2011 - trungdt - Add views FeatureTab, so, we must add configure that LinkList module will automatic remove html of body field
* Sep 22, 2011 - trungdt - Add No_search support
* 
*                ALTER TABLE `ag_linklistmodule_config` ADD `remove_body_html` INT( 1 ) NOT NULL DEFAULT '0' COMMENT '=0: No remove, =1: remove'
* 
* Sep 6, 2011 - trungdt - Add config: show Default view when in Administrator mode or not
* 
*    
*/

class linklistmodule_config {
	function form($object) {
		if (!defined('SYS_FORMS')) require_once(BASE.'subsystems/forms.php');
		exponent_forms_initialize();
		$form = new form();
		if (!isset($object->id)) {
			$object->application_name = '';
			$object->site_name='';
			$object->oauth2_client_id='';
			$object->oauth2_client_secret='';
			$object->oauth2_redirect_uri='';
            $object->developer_key='';
            
		} else {			
			$form->meta('id',$object->id);
		}

        
        $form->register('application_name','Application name',new textcontrol($object->application_name));
       $form->register('site_name','Site name',new textcontrol($object->site_name));
       $form->register('oauth2_client_id','Client id',new textcontrol($object->oauth2_client_id));
       $form->register('oauth2_client_secret','Client secret',new textcontrol($object->oauth2_client_secret));
       $form->register('oauth2_redirect_uri','Redirect uri',new textcontrol($object->oauth2_redirect_uri));
       $form->register('developer_key','Developer key',new textcontrol($object->developer_key));
		$form->register('submit','',new buttongroupcontrol('Save','','Cancel'));
		return $form;
	}

	function update($values,$object) {
		$object->application_name = $values['application_name'];
        $object->site_name=$values['site_name'];
        $object->oauth2_client_id=$values['oauth2_client_id'];
        $object->oauth2_client_secret=$values['oauth2_client_secret'];
        $object->oauth2_redirect_uri=$values['oauth2_redirect_uri'];
        $object->developer_key=$values['developer_key'];
        
		return $object;
	}
}

?>